<div id="DivIdToPrint">
<?php include_partial('dossiers/historiqueDossier', array('dossier'=>$dossier, 'showNextStage'=>false))?>

<fieldset><legend>Dossier</legend>
<?php
echo $objDef->renderDefault($dossier, array());
?>
</fieldset>
<fieldset><legend><?php echo $dossier->formulairedef->description?></legend>
<?php
echo $detailObjDef->renderDefault($dossier->getDetail(), array());
?>
</fieldset>
<div id="listeFichiers">
<?php 
	$q = Doctrine::getTable('attachment')
		->createQuery('m')
		->where('owner_id= ?', $dossier->id)
		->andWhere("ownerclass = ? ", get_class($dossier));
	$q->setHydrationMode(Doctrine_Core::HYDRATE_ARRAY);	
	$records =	$q->execute();
	if(count($records) > 0)
	{
		$objectDef = new objectDef('attachment');
		echo $objectDef->renderListTable($records,'dossiers',array('public'),true,false,false);
	}
?>
</div>

<?php if($editbutton):?>
	<a href="<?php echo url_for('@createDossier?formulaireDef='.$dossier['formulairedef_id'].'&idDossier='. $dossier['id'])?>">
	<button class="button_b" style="width:200px; float: right;">
		<img alt="" src="/images/icons/48/edit.png"><br/>
			Modifier
	</button></a>
<?php endif;?>
<?php if($backbutton):?>
	<?php if(!isset($backurl)) $backurl = '@userHome';?>
	<a href="<?php echo url_for($backurl)?>">
	<button class="button_b" style="width:200px; float: right;">
		<img alt="" src="/images/icons/48/confirm.png"><br/>
			Confirmer
	</button></a>
<?php endif;?>
</div>